import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import router from '@/router'
import axios from 'axios'
export const useCheckStore = defineStore('check',() => {
  async function CheckLog() {
    const checkL = await axios({
      url: '/api/user/checkLogin',
      method: 'post'
    })
    // console.log(checkL.data.code);

    if (checkL.data.code == 1010) {
      router.push({
        path: '/login'
      })
    }
    
    
  }
  return { CheckLog }
})
